﻿using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UCS.XNA.CombatBiplanes
{
    public class ContentManager
    {
        #region Public Members

        public readonly SpriteFont MenuItemFont;
        public readonly Texture2D MenuItemBorderTexture;
        public readonly Texture2D MenuItemCornerTexture;
        public readonly SpriteFont GameTitleFont;
        public readonly SpriteFont MenuTitleFont;
        public readonly SpriteFont MessageWindowFont;
        public readonly Texture2D AirplaneTexture1;
        public readonly Texture2D AirplaneTexture2;
        public readonly Texture2D AirplaneTexture3;
        public readonly Texture2D AirplaneTexture4;
        public readonly Texture2D RocketTexture;
        public readonly SpriteFont PlayersLifeFont;
        public readonly Texture2D GameBackground;
        public readonly Texture2D ExplosionTexture;

        #endregion

        #region Attributes and Properties

        private static ContentManager _instance;
        public static ContentManager Instance
        {
            get { return _instance; }
        }

        #endregion

        #region Constructors

        private ContentManager(SpriteFont menuItemFont, Texture2D menuItemBorderTexture, Texture2D menuItemCornerTexture,
                               SpriteFont gameTitleFont, SpriteFont menuTitleFont, SpriteFont messageWindowFont,
                               Texture2D airplaneTexture1, Texture2D airplaneTexture2,Texture2D airplaneTexture3,Texture2D airplaneTexture4,
                               Texture2D rocketTexture, SpriteFont playersLifeFont, Texture2D gameBackground, Texture2D explosionTexture)
        {
            this.MenuItemFont = menuItemFont;
            this.MenuItemBorderTexture = menuItemBorderTexture;
            this.MenuItemCornerTexture = menuItemCornerTexture;
            this.GameTitleFont = gameTitleFont;
            this.MenuTitleFont = menuTitleFont;
            this.MessageWindowFont = messageWindowFont;
            this.AirplaneTexture1 = airplaneTexture1;
            this.AirplaneTexture2 = airplaneTexture2;
            this.AirplaneTexture3 = airplaneTexture3;
            this.AirplaneTexture4 = airplaneTexture4;
            this.RocketTexture = rocketTexture;
            this.PlayersLifeFont = playersLifeFont;
            this.GameBackground = gameBackground;
            this.ExplosionTexture = explosionTexture;
        }

        #endregion

        #region Public Methods

        public static void Load(SpriteFont menuItemFont, Texture2D menuItemBorderTexture, Texture2D menuItemCornerTexture,
                                SpriteFont gameTitleFont, SpriteFont menuTitleFont, SpriteFont messageWindowFont,
                                Texture2D airplaneTexture1, Texture2D airplaneTexture2,Texture2D airplaneTexture3,Texture2D airplaneTexture4,
                                Texture2D rocketTexture, SpriteFont playersLifeFont, Texture2D gameBackground, Texture2D explosionTexture)
        {
            _instance = new ContentManager(menuItemFont, menuItemBorderTexture, menuItemCornerTexture,
                                           gameTitleFont, menuTitleFont, messageWindowFont,
                                           airplaneTexture1, airplaneTexture2, airplaneTexture3, airplaneTexture4,
                                           rocketTexture, playersLifeFont, gameBackground, explosionTexture);
        }

        #endregion
    }
}
